<?php
class node_Model_Node extends Zend_Db_Table_Abstract
{
	protected $_name = "nodes";
	protected $_primary = "id";
	
	public function findByPrimary($val)
	{
		if (!$val)
            return null;
        else
		    return $this->fetchRow($this->_primary . ' = ' . $this->getAdapter()->quote($val, 'INTEGER'));
	}
	
	public function setNodeTableName($name)
	{	
		$this->_name = $name;
		//BUGS: TODO: if called twice, this will make _primary an array. weird
		//hack the shit
		$this->_primary = "id"; 
	}
	
}
?>